package com.lq.dubbo.rocketmq.shop.api;

import com.lq.dubbo.rocketmq.shop.entity.Result;
import com.lq.dubbo.rocketmq.shop.shop_pojo.TradeGoods;
import com.lq.dubbo.rocketmq.shop.shop_pojo.TradeGoodsNumbersLogs;

/**
 * @program: dubborocketmqshop
 * @description:
 * @author: LQ
 * @create: 2021-06-04 16:35
 */
public interface IGoodsService {
    /**
     * 根据id查询商品对象
     *
     * @param goodsId
     * @return
     */
    TradeGoods findOne(Long goodsId);

    /**
     * 商品扣减库存
     *
     * @param goodsNumbersLogs 商品日志(包含订单id,商品id,商品数量)
     * @return 扣减结果
     */
    Result reduceGoodsNum(TradeGoodsNumbersLogs goodsNumbersLogs);
}
